﻿using System;
using System.Linq;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using eeenno.ReaderEngine;
using eeenno.ReaderEngine.Utilities;
using eeenno.ReaderEngine.Adapters;

namespace eeenno.SpeeedReaderUI.Forms
{
    public partial class AboutForm : Form
    {
        public AboutForm(long bytes_transferred)
        {       
            InitializeComponent();
#if !Marketplace
            if (RegistrationManager.IsRegistered())
            {
                menuItem_register.Enabled = false;
            }
#endif
            label_speeedreader.Text = "v" + SpeeedReader.MajorVersion() + "." + SpeeedReader.MinorVersion() +
                " Build " + SpeeedReader.BuildVersion();
            label_sent_recvd.Text = "Data Usage (estimated): " + bytes_transferred.ToString("N0") + " bytes";
            comboBox_chooser.SelectedIndex = 0;
        }

        private void menuItem_close_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void menuItem_send_feedback_Click(object sender, EventArgs e)
        {
            new MsgEngine().CreateEmail2("Speeed Reader v" + SpeeedReader.MajorVersion() + "." + SpeeedReader.MinorVersion()
            +" Feedback", "SpeeedReader@gmail.com");   
        }

        private void comboBox_chooser_SelectedIndexChanged(object sender, EventArgs e)
        {
            switch (comboBox_chooser.SelectedIndex)
            {
                case 0: //acknowledgements
                    label2.Text = "Developer - Evan Halley";
                    label2.Text += Environment.NewLine + "Testers - John M. Sengenberger II, ";
                    label2.Text += "Justin Hamlin, Christopher Droese, Jean-Paul Rondof, Gerrit van der Matten, ";
                    label2.Text += "Kai Nicholson, Chris Bingham, Mustafa Benali";
                    break;
                case 1: 
                    label2.Text = "©2009 eeenno mobile software" + Environment.NewLine;              
                    label2.Text += Environment.NewLine + "Speeed Reader will not distribute your personal information in any shape, form, or fashion.";
                    label2.Text += Environment.NewLine + "Speeed Reader nor eeenno mobile software assume any responsibility for any data or information loss while using Speeed Reader.";
                    label2.Text += Environment.NewLine + "By using Speeed Reader, you agree not to decompile, recreate, or reverse engineer any component of Speeed Reader.";
#if Tester
                    label2.Text += Environment.NewLine + "TEST VERSION";
#endif
#if DEBUG
                    label2.Text += Environment.NewLine + "DEBUG VERSION";
#endif
                    break;
                case 2: //support
                    label2.Text = "Email - SpeeedReader@gmail.com";
                    //label2.Text += Environment.NewLine + "Twitter - http://twitter.com/SpeeedReader";
                    //label2.Text += Environment.NewLine + "http://emuneee.com/eeenno-mobile";
                    break;
            }
        }

        private void menuItem_register_Click(object sender, EventArgs e)
        {
            RegisterForm register_form = new RegisterForm();
            if (register_form.ShowDialog() == DialogResult.OK)
            {
                menuItem_register.Enabled = false;
            }
        }
    }
}